package com.bawei.hgshop.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 *    订单  这里  Order 的原因是 尽可能的不与数据库的关键字相同 防止语法错误
 * @时间  2021-1-12  9:27:33
 *
 */
public class Orders implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2539028634472839240L;
	private int oid                  ; //订单的id
	private int uid                  ;// 用户id 
	private BigDecimal sumtotal             ; // 总价格 
	private String address              ;//配送地址
	private Date createTime          ; //创建时间
	
	private List<OrderDetail> details;//订单的详情
	
	
	public List<OrderDetail> getDetails() {
		return details;
	}
	public void setDetails(List<OrderDetail> details) {
		this.details = details;
	}
	public int getOid() {
		return oid;
	}
	public void setOid(int oid) {
		this.oid = oid;
	}
	public int getUid() {
		return uid;
	}
	public void setUid(int uid) {
		this.uid = uid;
	}
	public BigDecimal getSumtotal() {
		return sumtotal;
	}
	public void setSumtotal(BigDecimal sumtotal) {
		this.sumtotal = sumtotal;
	}
	

	
	
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Override
	public String toString() {
		return "Orders [oid=" + oid + ", uid=" + uid + ", sumtotal=" + sumtotal + ", address=" + address
				+ ", createTime=" + createTime + ", details=" + details + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		
		result = prime * result + oid;
		result = prime * result + uid;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Orders other = (Orders) obj;
		if (address != other.address)
			return false;
		if (createTime != other.createTime)
			return false;
		if (oid != other.oid)
			return false;
		if (sumtotal != other.sumtotal)
			return false;
		if (uid != other.uid)
			return false;
		return true;
	}
	
	
	


}
